package com.lidong.lowcode.model.controller;

import com.lidong.config.domain.gloabreturn.ResponseInfo;
import com.lidong.lowcode.base.domain.BaseParam;
import com.lidong.lowcode.base.domain.TreeVO;
import com.lidong.lowcode.model.service.ModelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author LiDong
 * @version 1.0.0
 * @createTime 5/10/2022 8:04 PM
 */
@RestController
@RequestMapping("/model")
public class ModelController {

    @Autowired
    private ModelService modelService;

    /**
     * 获取数据源分组树
     *
     * @return ResponseInfo
     */
    @RequestMapping("/tree")
    public ResponseInfo<List<TreeVO>> getTree(@RequestBody BaseParam baseParam) {
        return modelService.getTree(baseParam);
    }

}
